/** 
* All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
* 
* PmCommunicationManageServiceAuto
* 沟通管理
* 
* 修改纪录
* 2020-05-22 版本：1.0 sunxl 创建。
* @version 版本：1.0
* @author 作者：sunxl
* 创建日期：2020-05-22
*/

package com.topscomm.pm.service.impl.auto;

import javax.annotation.Resource;
import com.topscomm.basic.IBasicDao;
import com.topscomm.tap.common.DatacodeCache;
import java.util.Map;
import com.topscomm.pm.*;
import com.topscomm.pm.pojo.PmCommunicationManageEntity;
import com.topscomm.pm.dao.IPmCommunicationManageDao;


public class PmCommunicationManageServiceAuto extends PmService<PmCommunicationManageEntity,IPmCommunicationManageDao> {
	
	/**
	 * @author: sunxl
	 * @date: 2020-05-22
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("projectid") != null) {
			temp = mapRow.get("projectid").toString();
			mapRow.put("dispprojectid", datacodeCache.getValueDynamic("PmProject", temp, "id", "name"));
		}
		if (mapRow.get("category") != null) {
			temp = mapRow.get("category").toString();
			mapRow.put("dispcategory", datacodeCache.getValueDynamic("PmCommunicationManageCategory", temp, "code", "name"));
		}
		if (mapRow.get("flowid") != null) {
			temp = mapRow.get("flowid").toString();
			mapRow.put("dispflowid", datacodeCache.getValueDynamic("ApprovalFlow_PmCommunicationManage", temp, "id", "name"));
		}
		if (mapRow.get("state") != null) {
			temp = mapRow.get("state").toString();
			mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "pmCommunicationManageDao")
	public void setDao(IBasicDao<PmCommunicationManageEntity> dao) {		
		super.setDao(dao);
	}
}
